<?php

require_once('classes/Mapping/BasicProcessedMappingConfig.class.php');

class ProcessedFunctionMappingConfig extends BasicProcessedMappingConfig implements RequestMapping{

    public function ProcessedFunctionMappingConfig($fromUri, $toFunction){
        if (function_exists($toFunction)){
            $this->from = $fromUri;
            $this->to = $toFunction;
            return true;
        }else{
            throw new Exception('Couldn\'t find function');
        }
    }

    public function run(){
        $this->configObj->run();
        $func = $this->to;
        print $func();
    }

}

function testFunction(){
    return 'found';
}

?>